<template>
  <div>
    <dv-scroll-ranking-board :config="config" style="width:80%;height:300px;margin-left: 10%" />
  </div>
</template>
<script>

import { analyse } from '@/network/request'

export default {
  name: 'ScrollBoard',
  data () {
    return {
      from: {
        current: 0,
        mode: 0,
        size: 0
      },
      config: {
        data: [
        ]
      }
    }
  },
  methods: {
    createChart () {
      analyse(this.from).then(res => {
        this.config.data = res.data.map(item => ({
          name: item.deptName,
          value: Number(item.volunteerCount)
        }))
        this.config = { ...this.config }
      })
    }
  },
  created () {
    this.createChart()
  },
  mounted () {
    // setInterval(this.createChart, 3000)
  }
}
</script>
<style>
.dv-scroll-board .header {
  padding: 0;
  display: flex;
  position: relative;
  flex-shrink: 0;
  margin: 0;
  height: auto;
}
</style>
